#ifndef UMLTEXTCHILDITEM_H
#define UMLTEXTCHILDITEM_H

#include <QGraphicsTextItem>
#include <QTextDocument>

#include "uml/umlitem.h"

class UmlTextChildItem : public QGraphicsTextItem, public UmlItem
{
    Q_OBJECT
public:
    UmlTextChildItem(QGraphicsItem *parent = 0);

    void setWidth(qreal width);

    QRectF boundingRect() const;

    QSizeF size() const;

    void setIsHovered(bool isHovered);

    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);

    virtual void openEditor() = 0;

protected:
    qreal _width;

    bool _isHovered;

protected slots:
    virtual void updateUmlText();
};

#endif // UMLTEXTCHILDITEM_H
